#define _CRT_SECURE_NO_WARNINGS

#include<vector>
#include<iostream>
using namespace std;
#include<stack>
class Solution {
public:
    bool IsPopOrder(vector<int>& pushV, vector<int>& popV) {
        // write code here
        int cur1 = 0, cur2 = 0, n = pushV.size();
        stack<int> st;
        while (cur1 < n)
        {
            st.push(pushV[cur1++]);
            int s = st.top();
            while (st.top() == popV[cur2] && st.empty() == false)
            {
                st.pop();
                cur2++;
            }
        }
        return st.empty();
    };
};

int main()
{
    Solution s1;
    vector<int> v1 = { 1 };
    vector<int> v2 = { 1 };
    s1.IsPopOrder(v1, v2);
}